package main

import (
	"fmt"
)

//定义一个Profile结构体
type Profile struct {
	name   string
	age    int
	gender string
	mother *Profile
	father *Profile
}

//绑定方法
func (person Profile) FmtProfile() {
	fmt.Print("名字：%s\n",person.name)
	fmt.Print("年龄：%d\n",person.age)
	fmt.Print("性别：%s\n",person.gender)
}

//传值
func (person *Profile) increase_age() {
	person.age += 1
}

func main() {
	//实例化
	myself := Profile{
		name : "小明",
		age : 24,
		gender : "male",
	}
	myself.FmtProfile()

	//传值
	fmt.Print("当前年龄：%d",myself.age)
	myself.increase_age()
	fmt.Print("当前年龄：%d",myself.age)
}